1. Field
The described embodiments relate to techniques for formatting documents in a word processor. More specifically, the described embodiments relate to a technique for automatically configuring white space around an object in a document in a word processing application.
2. Related Art
Modern word processors include numerous features to assist with creating and editing documents. For example, virtually all word processors facilitate the placement and formatting of both text and non-textual objects such as tables, images, and charts in a document. In doing so, the word processors enable users to place objects in documents and to control the arrangement of text around the objects.
Most word processors include a setting that enables a user to configure the amount of white space that is maintained around objects in a document. This setting enables the user to control both the appearance of the objects and the space between the objects and surrounding text. For example, a word processor can enable a user to set a spacing of 12 pixels on each side of an object. In another example, the word processor can enable a user to set a different spacing value for each side of an object (e.g., 0.5 inch on the top and bottom of an object and 0.25 inch on the sides). The word processor then maintains at least the specified spacing between each side of an object and any nearby text.
In some cases, although the word processor maintains the configured amount of white space on each side of an object, the white space can appear to be larger on a given side of an object than the white space appears on the other side or sides of the object. For example, because fonts typically provide additional space for elements within some characters (e.g., for diacritical marks), when the word processor adds the configured white space between a character and an object, the additional space for the characters can cause the white space between the characters and the object to appear incorrect. Moreover, the word processor can displace text (e.g., shift the text down or to the side) based on the additional, space provided by a font, making the white space appear even larger. Thus, a user may have to manually adjust the white space settings for one or more sides of an object to ensure that the object displays with the desired amount of white space on each side of the object.